$(async function () {
    // console.log(location.search);
    let id = new URLSearchParams(location.search).get('id') || 0 ;
    console.log(id);
    if (id) {
        axios.get(`${host}/blogs/${id}`).then((res) =>{
            console.log(res);
            let blog = res.data.data;
            console.log(blog);
            $('input[name=title]').val(blog.title);
            $('input[name=author]').val(blog.author);     
        })
    }
})